# 语法糖
def outer(func):
    def inner(*args, **kwargs):
        print('函数执行前添加的功能')
        res = func(*args, **kwargs)
        print('函数执行后添加的功能')
        return res

    return inner


# @装饰器 语法糖 实现了 index = outer(index)
@outer
def index():
    print('from index')


@outer
def home():
    print('from home')


index()
home()
